// Table 5: Horizontal Dynasties and Poverty //

clear all
cap log close

global path ""
use "$path/Main.dta", clear
cd "$path/"

rdbwselect_2014 povincidence margin_rel, bwselect(CCT)
local bw_CCT = e(h_CCT)

rdbwselect_2014 povincidence margin_rel, bwselect(IK)
local bw_IK = e(h_IK)

xtset idcode

* Column 1
reg povincidence win, robust cluster(idcode_prov)
estadd ysumm
	
* Column 2
xi: xtreg povincidence win i.year, fe robust cluster(idcode_prov)
estadd ysumm

* Column 3
reg povincidence win mv_1 dmv_1, robust cluster(idcode_prov)
estadd ysumm

* Column 4
xi: xtreg povincidence win mv_1 dmv_1 i.year, fe robust cluster(idcode_prov)
estadd ysumm
	
* Column 5
reg povincidence win mv_1 dmv_1 mv_2 dmv_2, robust cluster(idcode_prov)
estadd ysumm

* Column 6
xi: xtreg povincidence win mv_1 dmv_1 mv_2 dmv_2 i.year, fe robust cluster(idcode_prov)
estadd ysumm

* Column 7
reg povincidence win if abs(margin_rel) <= `bw_CCT', robust cluster(idcode_prov)
estadd ysumm
		
* Column 8
xi: xtreg povincidence win i.year if abs(margin_rel) <= `bw_CCT', fe robust cluster(idcode_prov)
estadd ysumm

* Column 9
reg povincidence win if abs(margin_rel) <= `bw_IK', robust cluster(idcode_prov)
estadd ysumm
		
* Column 10
xi: xtreg povincidence win i.year if abs(margin_rel) <= `bw_IK', fe robust cluster(idcode_prov)
estadd ysumm
